package org.jackysoft.service;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.jackysoft.entity.HtmlFormTemplate;

public interface FormService {
	/**
	 * input 元素要设置显示的类型
	 */
	public static final Set<String> INPUT_TYPES = new HashSet<String>() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -79870059599191602L;

		{
			add("text");
			add("checkbox");
			add("image");
			add("file");
			add("submit");
			add("reset");
			add("password");
			add("button");

		}
	};

	/**
	 * <tt> 需要设置显示的htmlform元素tagname
	 * */
	public static final Set<String> FORM_TAGNAME = new HashSet<String>() {
		/**
		 * 
		 */
		private static final long serialVersionUID = -2930899167769167882L;

		{
			add("input");
			add("select");
			add("textarea");
			add("button");
		}
	};

	public String generateHtmlForm(long workflowId, String templateId);

	public String generateHtmlForm(int actionId, int stepId, long workflowId,
			Map<Integer, String> nextSteps, String templateId,boolean showOnly);

	String extractHtmlElementsToJson(HtmlFormTemplate temp) throws Exception;
}
